package com.anyun.collect.helper

import androidx.fragment.app.Fragment
import com.anyun.collect.R
import com.anyun.collect.fragments.*

/**collect
 * Created by lzw on 2019/12/4. 17:25:12
 * 邮箱：632393724@qq.com
 * All Rights Saved! Chongqing AnYun Tech co. LTD
 */
enum class VehicleBottomNavigationPosition (val position:Int, val id:Int){
    HOME(0, R.id.vehicle_home),
    DASHBOARD(1,R.id.vehicle_dash),



}

fun findVehicleNavigationPositionById(id: Int): VehicleBottomNavigationPosition = when (id) {
    VehicleBottomNavigationPosition.HOME.id -> VehicleBottomNavigationPosition.HOME
    VehicleBottomNavigationPosition.DASHBOARD.id -> VehicleBottomNavigationPosition.DASHBOARD


    else -> VehicleBottomNavigationPosition.HOME
}


fun VehicleBottomNavigationPosition.createFragment(): Fragment = when (this) {
    VehicleBottomNavigationPosition.HOME -> VehicleFragment.newInstance()
    VehicleBottomNavigationPosition.DASHBOARD -> VehicleIFragment.newInstance()

}

fun VehicleBottomNavigationPosition.getTag(): String = when (this) {
    VehicleBottomNavigationPosition.HOME -> VehicleFragment.TAG
    VehicleBottomNavigationPosition.DASHBOARD -> VehicleIFragment.TAG

}